package com.itheima.health.dao;

import com.github.pagehelper.Page;
import com.itheima.health.pojo.Setmeal;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @Description: 检查套餐dao 
* @Param:  
* @return:  
* @Author: HuChunping 
* @Date: 2021/1/10-18:03
*/
public interface SetmealDao {
    /**
     * @Description:  分页查询结果
     * @Param: [queryPageBean]
     * @return: com.github.pagehelper.Page<com.itheima.health.pojo.Setmeal>
     * @Author: HuChunping
     * @Date: 2021/1/10-20:18
     */
    Page<Setmeal> findPage(String queryString);

    /**
    * @Description: 添加检查套餐
    * @Param: [setmeal]
    * @return: void
    * @Author: HuChunping
    * @Date: 2021/1/10-18:15
    */
    void add(Setmeal setmeal);

    /**
    * @Description: 添加检查套餐检查组中间表
    * @Param: [setmealId, checkgroupId]
    * @return: void
    * @Author: HuChunping
    * @Date: 2021/1/10-18:24
    */
    void addSetmealCheckGroup(@Param("setmealId") Integer setmealId, @Param("checkgroupId") Integer checkgroupId);

    /**
    * @Description: 通过id查询套餐
    * @Param: [id]
    * @return: com.itheima.health.pojo.Setmeal
    * @Author: HuChunping
    * @Date: 2021/1/11-11:46
    */
    Setmeal findById(int id);

    /**
    * @Description: 通过套餐id查询勾选中的检查组
    * @Param: [id]
    * @return: java.lang.Integer[]
    * @Author: HuChunping
    * @Date: 2021/1/11-14:53
    */
    List<Integer> findCheckGroupIdsBySetmealId(int id);

    /**
    * @Description: 更新套餐
    * @Param: [setmeal]
    * @return: void
    * @Author: HuChunping
    * @Date: 2021/1/11-15:49
    */
    void update(Setmeal setmeal);

    /**
    * @Description: 删除检查组套餐中间表的内容
    * @Param: [id]
    * @return: void
    * @Author: HuChunping
    * @Date: 2021/1/11-15:59
    */
    void deleteBySetmealId(Integer id);

    /**
    * @Description: 通过id删除套餐
    * @Param: [id]
    * @return: void
    * @Author: HuChunping
    * @Date: 2021/1/11-16:41
    */
    void deleteById(int id);

    /**
    * @Description: 查询套餐是否被订单使用
    * @Param: [id]
    * @return: int
    * @Author: HuChunping
    * @Date: 2021/1/11-17:01
    */
    int findCountBySetmealId(int id);

    /**
    * @Description: 删除套餐与检查组关系表
    * @Param: [id]
    * @return: void
    * @Author: HuChunping
    * @Date: 2021/1/11-17:05
    */
    void deleteSetmealCheckGroup(int id);

    /**
    * @Description:  查询所有数据库套餐的垃圾图片，便于七牛的垃圾图片移除
    * @Param: []
    * @return: java.util.List<java.lang.String>
    * @Author: HuChunping
    * @Date: 2021/1/12-16:11
    */
    List<String> findImgs();

    /**
    * @Description: 查询所有套餐，用于用户端套餐展示
    * @Param: []
    * @return: java.util.List<com.itheima.health.pojo.Setmeal>
    * @Author: HuChunping
    * @Date: 2021/1/15-17:40
    */
    List<Setmeal> findAll();

    /**
    * @Description: 套餐详情页查询套餐详情
    * @Param: [id]
    * @return: java.util.List<com.itheima.health.pojo.Setmeal>
    * @Author: HuChunping
    * @Date: 2021/1/15-20:06
    */
    Setmeal findDetailById(int id);
}
